"""
进程类
"""
from multiprocessing import  Process
from time import sleep

class MyProcess(Process):
    def __init__(self,value):
        self.value = value
        # 拥有自己实例变量的同事也需要保留父类的
        super().__init__()
    # 进程要做的事情
    def run(self):
        for i in range(self.value):
            print("这是我要干的事情")
            sleep(2)
            print("干完了")


if __name__ == '__main__':
    myprocess = MyProcess(3)
    myprocess.start()